package itpenguin.train.common;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

import com.google.transit.realtime.GtfsRealtime.VehiclePosition.VehicleStopStatus;

public class Train implements Serializable {

	private static final long serialVersionUID = 1L;
	public float getLongitude() {
        return longitude;
    }
    public float getLatitude() {
        return latitude;
    }
    private float longitude;
    private float latitude;
    public VehicleStopStatus getStopStatus() {
        return stopStatus;
    }
    public String getBoundFor() {
        return boundFor;
    }
    public String getDirection() {
        return direction;
    }
    public String getKind() {
        return kind;
    }
    private VehicleStopStatus stopStatus;
    public void setBoundFor(String boundFor) {
        this.boundFor = boundFor;
    }
    private String boundFor;
    public void setDirection(String direction) {
		this.direction = direction;
	}
	public void setKind(String kind) {
		this.kind = kind;
	}
	private String direction;
    private String kind;
    public String getTripId() {
        return tripId;
    }
    public String getTrainId() {
        return trainId;
    }
    private String tripId;
    private String trainId;
    public String getRouteId() {
        return routeId;
    }
    private String routeId;
    
    private Date lastUpdateTime;
    
    private static final SimpleDateFormat DF;
    
    static {
    	SimpleDateFormat sdf = new SimpleDateFormat("yyyy/M/d HH:mm:ss");
    	sdf.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo"));
    	DF = sdf;
    }
    
    public String getLastUpdateTime() {
		return DF.format(lastUpdateTime);
	}
	public Train(float latitude, float longitude, VehicleStopStatus stopStatus, 
            String trainId, String tripId, String routeId, Date lastUpdateTime) {
        this.longitude = longitude;
        this.latitude = latitude;
        this.stopStatus = stopStatus;
        this.trainId = trainId;
        this.tripId = tripId;
        this.routeId = routeId;
        this.lastUpdateTime = lastUpdateTime;
    }
    
}
